package apiv1

import (
	"github.com/gin-gonic/gin"
	"go-shop-api/internal/service"
	"net/http"
)

//轮播图

// ListBanner 列表
func ListBanner(c *gin.Context) {
	var listBanner *service.BannerService
	//验证
	if err := c.ShouldBind(&listBanner); err != nil {
		//返回验证器验证的错误信息
		c.JSON(http.StatusOK, Validators(err))
		return
	}
	res := listBanner.List(c.Request.Context())
	c.JSON(http.StatusOK, res)
}
